package com.xingda.packing.dmds.http;

import com.alibaba.fastjson.JSONObject;
import com.xingda.packing.dmds.config.appset.AppSetUrl;
import com.xingda.packing.dmds.events.dto.PackageFloorInfoParam;
import lombok.extern.slf4j.Slf4j;

/**
 * 上传层装箱信息
 *
 * @author LEGION
 */
@Slf4j
public class PackageSaveHttp {

    public static JSONObject save(PackageFloorInfoParam eventPackageFloorInfo) {
        if (eventPackageFloorInfo == null) {
            return null;
        }
        String paramJson = JSONObject.toJSONString(eventPackageFloorInfo);
        try {
            JSONObject entityJson = BaseHttp.postBody(AppSetUrl.package_save_url, paramJson);
            log.info("层装箱上传参数为->：{}", paramJson);
            log.info("层装箱上传结果为->：{}", entityJson.toJSONString());
            return entityJson;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
